// 认证相关的类型定义
import type { FamilyMemberResponse } from "./family";

// 登录请求
export interface LoginRequest {
  username: string;
  password: string;
}

// 登录响应
export interface LoginResponse {
  access_token: string;
  token_type: string;
  family_member: FamilyMemberResponse;
}

// 注册请求
export interface RegisterRequest {
  username: string;
  email: string;
  password: string;
  full_name: string;
  family_name: string;
}

// Token 类型
export interface Token {
  access_token: string;
  token_type: string;
}

// 修改密码请求
export interface ChangePasswordRequest {
  current_password: string;
  new_password: string;
}

// 重新导出家庭成员相关类型
export type {
  FamilyRole,
  FamilyRelationship,
  FamilyMemberResponse,
} from "./family";

// 重新导出家庭成员相关类型
export type { FamilyMemberCreate, FamilyMemberUpdate } from "./family";

// HTTP 验证错误
export interface ValidationError {
  loc: (string | number)[];
  msg: string;
  type: string;
}

// HTTP 验证错误响应
export interface HTTPValidationError {
  detail?: ValidationError[];
}

// API 响应包装器
export interface ApiResponse<T> {
  data: T;
  message?: string;
  success: boolean;
}

// 登录表单数据
export interface LoginForm {
  username: string;
  password: string;
  rememberMe: boolean;
}

// 注册表单数据
export interface RegisterForm {
  username: string;
  email: string;
  password: string;
  confirmPassword: string;
  full_name: string;
  family_name: string;
}

// 表单验证错误
export interface FormErrors {
  [key: string]: string | undefined;
}

// 用户类型 (基于 FamilyMemberResponse)
export type User = FamilyMemberResponse;
